import { computed } from 'vue'
export function useVModel(props, propName, emit) {
    return computed({
        get() {
            return new Proxy(props[propName], {
                get(target, key) {
                    return target[key]
                },
                set(target, key, value) {
                    emit('update:' + propName, {
                        ...target,
                        [key]: value
                    })
                    return true
                }
            })
        },
        set(val) {
            emit('update:' + propName, val)
        }
    })
}